/*
 * $Id: SystemResourceProvider.java,v 1.4 2009/11/02 16:23:40 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.load.system.rmi;

import java.io.Serializable;
import java.util.List;

import com.ge.healthcare.autosc.common.database.pojo.ActTask;
import com.ge.healthcare.autosc.common.load.system.ISystemResource;
import com.ge.healthcare.autosc.common.load.system.ReadyQueueI;
import com.ge.healthcare.autosc.common.util.ApplicationInfo;
import com.ge.healthcare.autosc.common.util.PropertyConstants;

public class SystemResourceProvider implements ISystemResourceProvider, Serializable {
	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = -393340201937885363L;
	private static final int READY_QUEUE_MULTIPLIER = ApplicationInfo
	.getInstance().getIntegerPropertyValue(
			PropertyConstants.TO_FILL_QUEUE_MULTIPLIER, "9");
	private ReadyQueueI readyQueue;
	/**
	 * @param readyQueue the readyQueue to set
	 */
	public void setReadyQueue(ReadyQueueI readyQueue) {
		this.readyQueue = readyQueue;
	}
	public ISystemResource getToFillResource() {
		return this.readyQueue.exportSystemResource(READY_QUEUE_MULTIPLIER);
	}
	/**
	 * @return the readyQueue
	 */
	public ReadyQueueI getReadyQueue() {
		return readyQueue;
	}

	public List<ActTask> getExpiredTasksInRQ(){
		return this.readyQueue.getExpiredTasksInRQ();
	}
}
